<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center selectFavoriteposts_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub selectFavoriteposts_fd0_0'>
          <view class='flex flex-wrap align-center selectFavoriteposts_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <text class='fu-iconfont2  selectFavoriteposts_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='selectFavoriteposts_fd0_0_c1_c0'>选择帖子</text>
          </view>
          <view class='flex flex-wrap align-center justify-end selectFavoriteposts_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout selectFavoriteposts_flex_1">
        <view class='flex flex-wrap align-center selectFavoriteposts_fd1_0'>
          <image class='selectFavoriteposts_fd1_0_c0' mode="aspectFit" :src='STATIC_URL+"42.png"'></image>
          <benben-input class='flex-sub selectFavoriteposts_fd1_0_c1' type="text" :placeholder="`搜索`"
            confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
            v-model="keyworld" @confirm="getfavoritesFunc()" />
        </view>
        <view class='flex flex-wrap align-center justify-between selectFavoriteposts_fd1_1'>
          <view class='flex flex-wrap align-center'>
            <text class='selectFavoriteposts_fd1_1_c0_c0'>{{cname}}</text>
            <text class='selectFavoriteposts_fd1_1_c0_c0'>（</text>
            <text class='selectFavoriteposts_fd1_1_c0_c0'>{{postsType.length}}</text>
            <text class='selectFavoriteposts_fd1_1_c0_c0'>）</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <benben-flex-switch-new class-name='flex flex selectFavoriteposts_fd1_1_c1_c0' v-model="selectAll"
              :disabled='false' :auto='true' @change="selectPostsFunc()">
              <template v-slot:checked>

                <view class='flex flex position-relative align-center'>
                  <image class='selectFavoriteposts_checkfd1_1_c1_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"7.png"'>
                  </image>
                </view>

              </template>
              <template v-slot:unchecked>

                <view class='flex flex position-relative justify-end align-center'>
                  <image class='selectFavoriteposts_noCheckfd1_1_c1_c0_c1_c0' mode="aspectFit"
                    :src='STATIC_URL+"112.png"'></image>
                </view>

              </template>
            </benben-flex-switch-new>
            <text class='selectFavoriteposts_fd1_1_c1_c1'>全选</text>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout selectFavoriteposts_flex_2">
        <benben-select-diy ref="showSelectPopup1705114800422" class-name='flex flex-direction align-stretch flex'
          :label.sync="posts_name" :items.sync="postsType" v-model="posts_id" :select-all.sync="selectAll"
          default-type="aid" default-label="title" :allow-cancel='true' type="checkbox" :disabled='false'>
          <template v-for='(item,key0) in postsType'>
            <view v-if="item.isSelected" class='flex flex-direction align-stretch flex selectFavoriteposts_fd2_0_c0'
              :key="key0" @tap="$refs.showSelectPopup1705114800422.tapHandle(key0)">
              <view class='flex flex-wrap align-center justify-between'>
                <view class='text-cut-2 selectFavoriteposts_fd2_0_c0_c0_c0' style="width: 550rpx;">{{item.info.title}}
                </view>
                <image class='selectFavoriteposts_fd2_0_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"7.png"'></image>
              </view>
              <view class='flex flex-wrap align-center selectFavoriteposts_fd2_0_c0_c1'>
                <text class='selectFavoriteposts_fd2_0_c0_c1_c0'>{{item.info.content}}</text>
              </view>
              <view class='flex flex-wrap align-center selectFavoriteposts_fd2_0_c0_c2'>
                <image class='selectFavoriteposts_fd2_0_c0_c2_c0' mode="aspectFit" :src='item.info.avatar'></image>
                <text class='selectFavoriteposts_fd2_0_c0_c2_c1'>{{item.name}}</text>
                <text class='selectFavoriteposts_fd2_0_c0_c2_c2'>{{item.info.create_time}}</text>
                <text class='selectFavoriteposts_fd2_0_c0_c2_c3'>发布{{item.type_name}}</text>
              </view>
            </view>
            <view v-else class='flex flex-direction align-stretch flex selectFavoriteposts_fd2_0_c1' :key="key0"
              @tap="$refs.showSelectPopup1705114800422.tapHandle(key0)">
              <view class='flex flex-wrap align-center justify-between'>
                <view class='text-cut-2 selectFavoriteposts_fd2_0_c0_c0_c0' style="width: 550rpx;">{{item.info.title}}
                </view>
                <image class='selectFavoriteposts_fd2_0_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"8.png"'></image>
              </view>
              <view class='flex flex-wrap align-center selectFavoriteposts_fd2_0_c0_c1'>
                <text class='selectFavoriteposts_fd2_0_c0_c1_c0'>{{item.info.content}}</text>
              </view>
              <view class='flex flex-wrap align-center selectFavoriteposts_fd2_0_c0_c2'>
                <image class='selectFavoriteposts_fd2_0_c0_c2_c0' mode="aspectFit" :src='item.info.avatar'></image>
                <text class='selectFavoriteposts_fd2_0_c0_c2_c1'>{{item.name}}</text>
                <text class='selectFavoriteposts_fd2_0_c0_c2_c2'>{{item.info.create_time}}</text>
                <text class='selectFavoriteposts_fd2_0_c0_c2_c3'>发布{{item.type_name}}</text>
              </view>
            </view>
          </template></benben-select-diy>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center selectFavoriteposts_flex_3">
        <view class='flex flex-wrap align-center justify-center selectFavoriteposts_fd3_0'
          @click.stop="throwClassificationFunc">
          <text class='selectFavoriteposts_fd3_0_c0'>已选择</text>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "postsType": [{
          "name": "MOMO",
          "value": "1",
          "image": ""
        }, {
          "name": "KOKO",
          "value": "2",
          "image": ""
        }, {
          "name": "LOLO",
          "value": "3",
          "image": ""
        }],
        "posts_id": "",
        "selectAll": false,
        "aid": "",
        cname: '',
        posts_name: '',
        keyworld: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        aid,
        cname
      } = options
      if (aid !== undefined) this.aid = aid
      if (cname !== undefined) this.cname = cname
      this.getfavoritesFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      throwClassificationFunc() {
        let obj = {
          aid: this.posts_id.split(','),
          name: this.posts_name.split(',')
        }
        console.log('obj', obj)
        uni.$emit('tiezi', obj)
        this.$urouter.navigateBack(1);
      },
      //获取收藏夹
      getfavoritesFunc() {
        this.minixPagingListsApi = global.apiUrls.post657bc537a3a42;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          usercollectioncate: this.aid,
          type: 1,
          title: this.keyworld
        }
        this.listData = [];
        this.postsType = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      },
      //全选帖子
      selectPostsFunc() {
        this.$refs.showSelectPopup1705114800422.checkAll();
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 248, 1);
    background-size: 100% auto;
  }

  .selectFavoriteposts_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .selectFavoriteposts_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .selectFavoriteposts_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .selectFavoriteposts_fd0_0_c0 {
    width: 120rpx;
  }

  .selectFavoriteposts_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .selectFavoriteposts_flex_1 {
    padding: 14rpx 32rpx 0rpx 32rpx;
  }

  .selectFavoriteposts_fd1_1_c1_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .selectFavoriteposts_noCheckfd1_1_c1_c0_c1_c0 {
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    width: 36rpx;
    height: 36rpx;
  }

  .selectFavoriteposts_checkfd1_1_c1_c0_c0_c0 {
    width: 36rpx;
    height: 36rpx;
    border-radius: 24rpx 24rpx 24rpx 24rpx;
  }

  ::v-deep .selectFavoriteposts_fd1_1_c1_c0 {
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd1_1_c0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .selectFavoriteposts_fd1_1 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd1_0_c1 {
    color: #333;
    font-size: 28rpx;
  }

  .selectFavoriteposts_fd1_0_c0 {
    width: 24rpx;
    height: 24rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd1_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 50rpx;
    background-size: 100% auto;
    padding: 16rpx 24rpx 16rpx 24rpx;
  }

  .selectFavoriteposts_flex_2 {
    margin: 24rpx 0rpx 0rpx 0rpx;
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .selectFavoriteposts_fd2_0_c1 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 32rpx 24rpx 32rpx 24rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c2_c3 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c2_c2 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 17rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c2_c1 {
    color: #333333;
    font-size: 24rpx;
    font-weight: 700;
    line-height: 32rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c2_c0 {
    width: 48rpx;
    height: 48rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 14rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c2 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 44rpx;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .selectFavoriteposts_fd2_0_c0_c1 {
    margin: 20rpx 0rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c0_c1 {
    width: 36rpx;
    height: 36rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .selectFavoriteposts_fd2_0_c0_c0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .selectFavoriteposts_fd2_0_c0 {
    background: rgba(255, 255, 255, 1);
    padding: 32rpx 24rpx 32rpx 24rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .selectFavoriteposts_flex_3 {
    position: fixed;
    bottom: calc(64rpx + var(--window-bottom));
    left: 215rpx;
  }

  .selectFavoriteposts_fd3_0_c0 {
    color: #FFFFFF;
    font-size: 32rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .selectFavoriteposts_fd3_0 {
    background: rgba(100, 80, 235, 1);
    border-radius: 44rpx;
    background-size: 100% auto;
    box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(0, 0, 0, 0.08);
    width: 320rpx;
    height: 88rpx;
  }
</style>
